import React, { memo } from "react";
import { useHistory } from "react-router-dom";
import { HomeTitleWrapper } from "./style";
import SmallYouIcon from "@/assets/img/small_you_icon.png";
import { SearchOutlined } from "@ant-design/icons";

export default memo(function HomeTitle() {
  const history = useHistory();
  // 跳转到搜索界面
  const jumpToSearchPage = () => {
    history.push("/search");
  };

  return (
    <HomeTitleWrapper>
      <img src={SmallYouIcon} alt="" className="icon" />
      <span className="title">小柚-分享每一种生活</span>
      <span className="search" onClick={jumpToSearchPage}>
        <SearchOutlined style={{ fontSize: "23px", color: "#000" }} />
      </span>
    </HomeTitleWrapper>
  );
});
